import {req_post} from "../ApiInterface";
import md5 from 'js-md5'
function registUrl(bodydata,callback) {
  let param="param";
  bodydata['username'] ? param = param + bodydata['username'] : null;
  bodydata['password'] ? param = param + bodydata['password'] : null;
  bodydata['comitpassword'] ? param = param + bodydata['comitpassword'] : null;
  bodydata['mobile'] ? param = param + bodydata['mobile'] : null;
  bodydata['mobile_code'] ? param = param + bodydata['mobile_code'] : null;
  let md51 = md5(param).toString();
  bodydata.keyStr=md51;
  const netapi="registUrl";
  console.log(bodydata,'用户注册');
  req_post(netapi,bodydata,callback);
}
function getMobileReqCode(bodydata, callback) {

  let param = 'param';
  bodydata['mobile'] ? param = param + bodydata['mobile'] : null;
  //  密码md5 加密
  let md51 = md5(param).toString();
  bodydata.keyStr = md51;

  let netapi = 'getMobileCode';
  console.log(bodydata,'手机验证码');
  req_post(netapi,bodydata,callback);
}

function loginAccount(bodydata, callback) {

  let param = 'param';
  bodydata['username'] ? param = param + bodydata['username'] : null;
  bodydata['password'] ? param = param + bodydata['password'] : null;
  //  密码md5 加密
  let md51 = md5(param).toString();
  bodydata.keyStr = md51;

  let netapi = 'loginUrl';
  console.log(bodydata,'用户登陆');
  req_post(netapi, bodydata, callback);
}
export {
  registUrl,
  getMobileReqCode,
  loginAccount
}
